-- card: 3848 from stack: in.1 -- bmap block id: 0 -- flags: 4000 -- background id: 2736 -- name: ----- HyperTalk script ----- on openCard hide menuBar hide background field "Script" put empty into background field "Import Text" put untitled into background field "fname" put empty into temp hide background field "SaveDialogBox" hide background field "TextFileName" hide background button "OK" hide background button "Okay" hide background button "Cancel" hide background field "About..." hide background button "Script" hide background button "RemoveScript" Set textStyle of background field "Import Text" to plain Set textFont of background field "Import Text" to Monaco Set textSize of background field "Import Text" to 9 end openCard on idle put the long date into field "Date" put the time into field "Time" pass idle end idle -- part contents for background part 15 ----- text ----- Friday, September 11, 1987 -- part contents for background part 16 ----- text ----- 11:09 PM -- part contents for background part 19 ----- text ----- HyperCard Text File Importer V1.1 A simple stack with text file Open, Save, and Save as... & Print capabilities. A New or Save as... text file will be saved using the file name & path entered unless changed. I.E. Hard Disk:Document folder:text file Should be used only with small text files up to 16,384 bytes. Larger files will be opened but the end of the file will be truncated and only the displayed file will be saved. Thought this stack would be useful to those people, like me, who don't have a HyperTalk manual yet and wish to look at other's scripts to get ideas. Other notes in the script report. Click the Script button to clear the text window and show the entire stack script. Click on "Remove Script Report" below to permanently remove the script text & button to compact the script size by about 4K. Have Fun! Dick Van Hooft CS: 71310,2130 GEnie: D.VANHOOFT 9/11/87 -Remove Script Report- -- part contents for background part 21 ----- text ----- Enter file name & path to save text file -- part contents for background part 28 ----- text ----- SCRIPTS FOR STACK: Importer V1.1 - Dick Van Hooft - 9/11/87 Script Report courtesy of "Script Report by Eric Alderman" Notes - Uses XCFN resource Get FileName() for Open. Shortcuts for selecting menubar (option-spacebar toggles) click on left side of file name header to show menubar ckick on right side of file name header to hide menubar ** STACK SCRIPT ************************************ ** BACKGROUND #1 *********************************** ** BKGND #1, BUTTON #1: Open... ******************** on mouseUp Get FileName("TEXT") if it is empty then exit mouseUp else put it into temp put it into background field "fname" end if open file temp read from file temp for 16384 put it into infile if it is empty then close file temp close file temp put infile into background field "Import Text" end mouseUp ** BKGND #1, BUTTON #2: New ************************************ on mouseUp put empty into background field "fname" put empty into background field "Import Text" end mouseUp ** BKGND #1, BUTTON #3: Save ************************************ on mouseUp if background field "fname" is empty then put empty into background field "TextFileName" show background field "SaveDialogBox" show background field "TextFileName" show background button "OK" show background button "Cancel" else put background field "fname" into save open file save write background field "Import Text" to file save close file save end if end mouseUp ** BKGND #1, BUTTON #4: Print ************************************ on mouseUp doMenu Print Report... end mouseUp ** BKGND #1, BUTTON #5: Home ************************************ on mouseUp put empty into background field "Import Text" doMenu Compact Stack go home end mouseUp ** BKGND #1, BUTTON #6: Find... ************************************ on mouseUp doMenu Find... end mouseUp ** BKGND #1, BUTTON #7: About ************************************ on mouseUp show background field "About..." show background button "Okay" if background field "Script" is empty then exit mouseUp else show background button "Script" show background button "RemoveScript" end if end mouseUp ** BKGND #1, BUTTON #8: Okay ************************************ on mouseUp hide background button "Okay" hide background button "Script" hide background button "RemoveScript" hide background field "About..." end mouseUp ** BKGND #1, BUTTON #9: OK ************************************ on mouseUp if background field "TextFileName" is empty then exit mouseUp end if put background field "TextFileName" into save open file save write background field "Import Text" to file save close file save hide background button "OK" hide background button "Cancel" hide background field "TextFileName" hide background field "SaveDialogBox" put empty into background field "TextFileName" end mouseUp ** BKGND #1, BUTTON #10: Cancel ************************************ on mouseUp hide background button "OK" hide background button "Cancel" hide background field "TextFileName" hide background field "SaveDialogBox" put empty into background field "TextFileName" end mouseUp ** BKGND #1, BUTTON #11: Script ************************************ on mouseUp put empty into background field "Import Text" put background field "Script" into background field "Import Text" hide background button "Okay" hide background button "Script" hide background button "RemoveScript" hide background field "About..." end mouseUp ** BKGND #1, BUTTON #12: Save as... ************************************ on mouseUp if background field "fname" is empty then put empty into background field "TextFileName" else put background field "fname" into background field "TextFileName" end if show background field "SaveDialogBox" show background field "TextFileName" show background button "OK" show background button "Cancel" end mouseUp ** BKGND #1, BUTTON #13: ShowMenuBar ************************************ on mouseUp show menuBar end mouseUp ** BKGND #1, BUTTON #14 ************************************ on mouseUp hide menuBar end mouseUp ** BKGND #1, BUTTON #15: RemoveScript ************************************ on mouseUp put empty into background field "Script" end mouseUp ** CARD #1 ************************************ on openCard hide menuBar hide background field "Script" put empty into background field "Import Text" put empty into background field "fname" put empty into temp hide background field "SaveDialogBox" hide background field "TextFileName" hide background button "OK" hide background button "Okay" hide background button "Cancel" hide background field "About..." hide background button "Script" hide background button "RemoveScript" Set textStyle of background field "Import Text" to plain Set textFont of background field "Import Text" to Monaco Set textSize of background field "Import Text" to 9 end openCard on idle put the long date into field "Date" put the time into field "Time" pass idle end idle -- part contents for background part 29 ----- text ----- untitled